package com.liqw.crawler.crawler.processor;

import org.springframework.stereotype.Component;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@Component
public class AbstractPageProcessorManager {
    private static Map<String, AbstractPageProcessor> pageProcessorMap = new ConcurrentHashMap<>();

    public AbstractPageProcessor getAbstractPageProcessor(String type) {
        return pageProcessorMap.get(type);
    }

    public static void addPageProcessor(AbstractPageProcessor abstractPageProcessor) {
        pageProcessorMap.put(abstractPageProcessor.getType(), abstractPageProcessor);
    }
}
